<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>再见Vue</title>
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id="app">
    <div v-if="isLogin">{{welcome}}</div>
    <div v-else>{{msg}}</div>
    <!-- <div v-show="isLogin">{{welcome}}</div>
    <div v-show="true">{{msg}}</div> -->

    <button v-if="isLogin" @click="isLogin = false">退出</button>
    <button v-else @click="loginHandler">登录</button>

  </div>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        msg: '请登录',
        isLogin: false,

        welcome: '欢迎使用'
      },
      methods: {
        loginHandler() {
          this.isLogin = true
        }
      }
    })
  </script>
</body>

</html>